package com.sxkj.web.controller.pay;

import com.sxkj.common.response.ResponseResult;
import com.sxkj.entity.entity.sys.User;
import com.sxkj.service.pay.XyPayService;
import com.sxkj.service.wechat.WechatUserService;
import com.sxkj.web.config.XyPayConfig;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Zhang Xingliang
 * @description: 微信用户
 * @date 2019-12-25 09:39:56
 */
@RestController
@RequestMapping("/pay/xypay")
public class XyPayController {

    @Autowired
    private WechatUserService wechatUserService;

    @Autowired
    private XyPayService xyPayService;

    @Autowired
    private XyPayConfig xyConfig;

    @ApiOperation(value = "查询微信用户列表")
    @RequestMapping(value = "/microPay")
    public ResponseResult microPay(@RequestBody Map<String, String> requestData) {
        try {
            Map<String, String> resMap = xyPayService.micropay(requestData);
            return ResponseResult.success();
        } catch (Exception e) {
            return ResponseResult.failure(e.toString());
        }
    }

}
